{include file="public/header" select="0" /}
<body class="bgc hide-top">
<form id="form">
<div class="cart-container">
    <img src="/static/index/img/icon50.png" alt="">
    <div class="cart-content">
        <div class="cart-hd flex-center">购物车
            {if count($list) > 0}
            <p class="edit">编辑</p>
            {/if}
        </div>
        <ul class="cart-list carList">
            {foreach name="list" item="vo" }
            <li class="parent">
                <input type="checkbox" class="one" name="cart_id[]" value="{$vo.id}">
                <p class="flex-center" onclick="load_href('{:url(\'product/details\')}?id={$vo.product.id}',2)">
                    <img src="{$vo.product.icon}" alt="">
                </p>
                <div class="rgt">
                    <p class="single">{$vo.product.title}</p>
                    <div class="flex-layout btm">
                        <p class="cart_price bsclr_org">￥<span class="price">{$vo.product.price}</span></p>
                        <div class="stepper carNum">
                            <p class="minus">-</p>
                            <input class="inpNum" type="number" name="num" id="num" value="{$vo.num}"
                                   onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,0})?).*$/g, '$1')">
                            <p class="add">+</p>
                        </div>
                    </div>
                </div>
            </li>
            {/foreach}
        </ul>
    </div>
</div>
<div class="cart-footer flex-layout">
    <div class="left carBtm">
        <label>
            <input type="checkbox" class="checkbox_all">
            全选
        </label>
        <div class="sum">
            <p>总计<span class="amount">0.00</span></p>
        </div>
    </div>
    <div class="rgt flex-layout" lay-filter="save" lay-submit>去结算</div>
    <ul class="submit-del" style="display: none;">
        <li lay-filter="delete" lay-submit>删除</li>
        <li class="empty">清空</li>
    </ul>
</div>
</form>
{include file="public/nav" select="3" /}
{include file="public/footer" select="0" /}
<script src="/static/index/js/cart.js"></script>
<script>
    var type = 1
    $('.edit').click(function () {
        if (type == 1) {
            $(this).html('完成')
            type = 2
            $('.sum').hide()
            $('.cart-footer .rgt').hide()
            $('.submit-del').show()
        } else {
            $(this).html('编辑')
            type = 1
            $('.sum').show()
            $('.cart-footer .rgt').show()
            $('.submit-del').hide()
        }
    })
</script>
</body>
</html>